package com.jeesite.modules.jydq.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品价格表Entity
 * @author dong
 * @version 2025-03-20
 */
@Table(name="jydq_product_price", alias="a", label="商品价格表信息", columns={
		@Column(name="id", attrName="id", label="编号", isPK=true),
		@Column(name="product_id", attrName="productId", label="商品ID"),
		@Column(name="product_name", attrName="productName", label="商品", queryType=QueryType.LIKE),
		@Column(name="platform_id", attrName="platformId", label="平台ID"),
		@Column(name="platform_name", attrName="platformName", label="平台", queryType=QueryType.LIKE),
		@Column(name="current_price", attrName="currentPrice", label="当前售价"),
		@Column(name="price_validity", attrName="priceValidity", label="价格生效时间"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注", queryType=QueryType.LIKE),
	}, orderBy="a.update_date DESC"
)
public class JydqProductPrice extends DataEntity<JydqProductPrice> {
	
	private static final long serialVersionUID = 1L;
	private String productId;		// 商品ID
	private String productName;		// 商品
	private String platformId;		// 平台ID
	private String platformName;		// 平台
	private Double currentPrice;		// 当前售价
	private Date priceValidity;		// 价格生效时间

	public JydqProductPrice() {
		this(null);
	}
	
	public JydqProductPrice(String id){
		super(id);
	}
	
	@NotBlank(message="商品ID不能为空")
	@Size(min=0, max=64, message="商品ID长度不能超过 64 个字符")
	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}

	@NotBlank(message="平台不能为空")
	@Size(min=0, max=128, message="平台长度不能超过 128 个字符")
	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}
	
	@NotBlank(message="平台ID不能为空")
	@Size(min=0, max=64, message="平台ID长度不能超过 64 个字符")
	public String getPlatformId() {
		return platformId;
	}

	public void setPlatformId(String platformId) {
		this.platformId = platformId;
	}
	
	@NotBlank(message="平台不能为空")
	@Size(min=0, max=64, message="平台长度不能超过 64 个字符")
	public String getPlatformName() {
		return platformName;
	}

	public void setPlatformName(String platformName) {
		this.platformName = platformName;
	}
	
	@NotNull(message="当前售价不能为空")
	public Double getCurrentPrice() {
		return currentPrice;
	}

	public void setCurrentPrice(Double currentPrice) {
		this.currentPrice = currentPrice;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
	@NotNull(message="价格生效时间不能为空")
	public Date getPriceValidity() {
		return priceValidity;
	}

	public void setPriceValidity(Date priceValidity) {
		this.priceValidity = priceValidity;
	}
	
}